package com.i.MyString.Question;

import java.util.Scanner;
/**
 * 将String类型转换为int类型
 * 1.将String直接转换成int类型
 * 2.将String转换为Integer，再把Integer转换为int类型*/
public class TestString_int {
    public static void main(String[] args) {
        String s1=new String("hello");
        String s2=new String("hello");
        System.out.println(s1.getClass());
        System.out.println(s2.getClass());
        System.out.println(s1 ==s2);
        System.out.println(s1.equals(s2));
        /*Scanner input=new Scanner(System.in);
        System.out.print("请输入一个字符:");
        String s = input.nextLine();

        //1.将String直接转换成int类型
        //int a =s.codePointAt(0);
        //System.out.println(a);
        //2.将String转换为Integer，再把Integer转换为int类型
        //int b=Integer.parseInt(s);
       // System.out.println(b);
        int a = 0;
        Integer integer = new Integer(s);
        int i = integer.intValue();
        System.out.println(i+" 11a");*/

    }
}
